package com.ledi.guns.common.persistence.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ledi.guns.common.persistence.model.ClassInfo;
import com.ledi.guns.common.persistence.model.vo.ClassInfoVo;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ledi
 * @since 2017-11-30
 */
public interface ClassInfoMapper extends BaseMapper<ClassInfo> {

	List<ClassInfoVo> pageList(Page<ClassInfoVo> page, Map search);

	@Select("select ci.id ,ci.order_num ,ci.`name` from t_teacher_class_map cm left JOIN t_class_info ci on ci.id =cm.class_id  where cm.teacher_id=#{teacherId} and ci.school_id=#{schoolId}  and ci.grade_id=#{gradeId} and ci.is_delete=0")
	List<ClassInfo> selectByTeacherId(@Param("teacherId") Long teacherId, @Param("schoolId") Long schoolId, @Param("gradeId") Long gradeId);

}
